﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<span class="title1">发短消息</span>
<html:form action="/msg" onsubmit="return msgValidate(this);">
<input type="hidden" name="action" value="add"/>
<input type="hidden" name="from" value="views"/>
<table cellpadding="0" class="qlist" cellspacing="0" id="message">
    <tr>
        <td align="right">接收者：</td>
        <td><html:text property="toUserLoginName" value="${toUserLoginName}" size="30"/>*</td>
    </tr>
    <tr>
        <td align="right">主题：</td>
        <td><html:text property="title" size="30" maxlength="30"/>*</td>
    </tr>
    <tr>
        <td align="right">内容：</td>
        <td><html:textarea property="content" rows="6" cols="60"/>(最长200个字符)</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td><input type="submit" value="发送" name="submitButt"/>&nbsp;&nbsp;&nbsp;<input type="button" value="返回" onclick="history.back();"/></td>
    </tr>
</table>
</html:form>
    <script type="text/javascript">
        function msgValidate(pForm)
        {
            var toUserLoginName = pForm.toUserLoginName.value;
            if(toUserLoginName == "")
            {
                alert("[接收者]必须！");
                pForm.toUserLoginName.focus();
                return false;
            }
            var title = pForm.title.value;
            if(title == "")
            {
                alert("主题必须大于6个字符！");
                pForm.title.focus();
                return false;
            }
            var content = pForm.content.value;
            if(content.length > 200)
            {
                alert("内容必须小于200个字符！");
                return false;
            }
            pForm.submitButt.value = "正在发送...";
            pForm.submitButt.disabled = true;
            return true;
        }
    </script>

